<!DOCTYPE html>
<html>
<head>
    <title>个人中心</title>
    <%- include('../../_global/baseLibs') %>
    <script src="/static/js/crypto-js.js"></script>
    <script src="/static/lib/touchslider.js"></script>
    <script type="text/javascript">
        var page_personal = (function($, page_personal) {
            var uri_service_queryTx = '/api/gzd/jrlb/queryTx';
            var key = "jkcs";
            /*默认配置*/
            var cfg_def = {
                /*退出按钮回调*/
                quiteClickHandler: quiteClickHandler
            }

            page_personal.setCfg = function(cfg){
                $.extend(page_personal, cfg_def, cfg);
            }

            page_personal.init = function(){

                $.JkcsUserInfo.getUserInfoGzd({
                    callback: function(userInfo){
                        page_personal.userInfo = userInfo;
                        var dom = null;
                        if (StringUtils.isEmpty(userInfo['xm'])) {
                            dom = $($('#userInfoDOMDWS').html());
                            dom.find('a').on('click', function(){
                                $.pageSwitch.goToUrl("family","familyAdd");
                            })
                        } else {
                            dom = $($('#userInfoDOM').html());
                            dom.find(".h3-name").html(userInfo['xm']);
                            var sfzhNew = userInfo['sfzh'].substr(0,3)+"*******"+userInfo['sfzh'].substr((userInfo['sfzh'].length-3),3);
                            dom.find(".span-sfzh").html(sfzhNew);
                            var lxdh = userInfo['sj'].substr(0,3)+"***"+userInfo['sj'].substr((userInfo['sj'].length-3),3);
                            dom.find(".span-lxdh").html(lxdh);
                        }
                        $('#UserInfo').append(dom);

                        if (!StringUtils.isEmpty(userInfo['txid'])) {
                            var txid = userInfo['txid'];
                            $.QuickRemote.AjaxJson({
                                funcName: uri_service_queryTx
                                ,params: {txid: txid}
                                ,callback: function(result) {
                                    var src = result['src'];
                                    if(!StringUtils.isEmpty(src)){
                                        $(".user-photo img").attr("src", src);
                                    }
                                }
                            });
                        }
                    }
                });
                //页面跳转控制
                //健康档案
                $("#healthDoc").on('click',healthDocClickHandler);
                $.pageSwitch.clickToUrl(".default-list","selfCenter");
                $.pageSwitch.clickToUrl(".tab-box","selfCenter");
                $("#quite").on('click', page_personal.quiteClickHandler);
            }

            function quiteClickHandler(){
                clearCookis();
                $.pageSwitch.goToUrl("beforLogin", "login");
            }
             /*业务模块健康档案点击回调*/
            function healthDocClickHandler() {
                var patientCardId = page_personal.userInfo && page_personal.userInfo["sfzh"]? page_personal.userInfo["sfzh"]:"";
                var idCard = encryptionStr(key, patientCardId);
                if(patientCardId && patientCardId!=""){
                    $.pageSwitch.goToUrl("jkda","main","idCard=" + idCard + "&key=" + key);
                }else{
                    $.QuickAlert.alertConfirm({
                        content: "未查到用户信息，请在家人列表补充本人信息！", btn: ["现在就去", "以后再说"], callback: function () {
                            $.pageSwitch.goToUrl("family","familyAdd");
                        }
                    });
                }
            }
            function encryptionStr(key, plaintText){
                key = CryptoJS.enc.Utf8.parse(key);
                var encryptedData = CryptoJS.AES.encrypt(plaintText, key, {
                    mode: CryptoJS.mode.ECB,
                    padding: CryptoJS.pad.Pkcs7
                });
                var encryptedStr = encryptedData.ciphertext.toString();
                return encryptedStr;
            }

            return page_personal;
        })(jQuery, {});
    </script>
    <style type="text/css">
        .hasNews{
            width: .8rem;
            height: .8rem;
            border-radius: .4rem;
            float: right;
            display: none;
            background: red;
            margin-top: .6rem;
        }
        
 
   .page-user .user-info-box.user-info-bgc-right {
    background: url("/static/images/info/userInfo_bg.png") 0 0 no-repeat;
    background-size: 100% 100%; }
    .page-user .user-photo1 {
    width: 5rem;
    height: 5rem;
    overflow: hidden;
    border-radius: 50%;
    background-size: 100% 100%;
    position: absolute;
    top: 47%;
    transform: translate(0, -50%);
    left: 3rem;
    border: 1px solid #ccc;
 }
.page-user .user-photo1 img {
    width: 100%;
    height: 100%; }
    .page-user .user-sign-box1 {
      position: absolute;
    top: 3.5rem;
    left: 11rem;
    width: 16.5rem;
    color: #fff; }
  
  .page-user .user-sign-box1 .sign-box {
    display: block; }
    .page-user .user-sign-box1 .sign-box span {
      position: relative;
      display: inline-block;
      font-size: 1.2rem;
      border-radius: 1rem;
      color: #fff; }
      .page-user .user-sign-box1 .h3-name {
    font-size: 1.35rem;
    color: #fff;
    font-weight: bold; }
    .page-user .user-sign-box1 .sign-box .agree {
        border:1px solid #63ffcc;
        color: #63ffcc;
        margin-left: 1.8rem;
        border-radius: 0.5rem;
        padding: 0 0.3rem;
       }
    .page-user .user-sign-box1 .sign-box .agree i {
      display: inline-block;
      vertical-align: middle;
      width: 1rem;
      height: 1rem;
      position: relative;
      bottom: 2px;
      background: url("/static/images/family/yellow_agree.png") no-repeat;
      background-size: cover;
          
       }
    .page-user .user-sign-box1 .sign-box .one i {
      display: inline-block;
      vertical-align: middle;
      width: 2.25rem;
      height: 0.9rem;
      position: relative;
      bottom: 2px;
      background: url("/static/images/selfCenter-new/1+1+1.png") no-repeat;
      background-size: cover; }
        
        /*中间图标设置*/

      .page-index .icon-list ul > li .block-a .icon-box.icon_jkda {
        background: url("/static/images/family/icon_jkda.png") no-repeat;
        background-size: cover; }
        .page-index .icon-list ul > li .block-a .icon-box.icon_jtys {
        background: url("/static/images/family/icon_jtys.png") no-repeat;
        background-size: cover; }
        .page-index .icon-list ul > li .block-a .icon-box.icon_jzgl {
        background: url("/static/images/family/icon_jzgl.png") no-repeat;
        background-size: cover; }
        .page-index .icon-list ul > li .block-a .icon-box.icon_wdsc {
        background: url("/static/images/family/icon_wdsc.png") no-repeat;
        background-size: cover; }
        /*列表小图标*/
        .page-user .icon-bar.icon_qqzh {
            background: url("/static/images/family/icon_qqzh.png") no-repeat;
            background-size: cover; 
        }
        .page-user .icon-bar.icon_ghjl {
            background: url("/static/images/family/icon_ghjl.png") no-repeat;
            background-size: cover; 
        }
        .page-user .icon-bar.icon_jzjl {
            background: url("/static/images/family/icon_jzjl.png") no-repeat;
            background-size: cover; 
        }
        .page-user .icon-bar.icon_jfjl {
            background: url("/static/images/family/icon_jfjl.png") no-repeat;
            background-size: cover; 
        }
        .page-user .icon-bar.icon_zyjl {
            background: url("/static/images/family/icon_zyjl.png") no-repeat;
            background-size: cover; 
        }
        .page-user .icon-bar.icon_zxzx {
            background: url("/static/images/family/icon_zxzx.png") no-repeat;
            background-size: cover; 
        }
    .page-user .user-sign-box1 a {
  background: transparent;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  color: #fff; }
    </style>
</head>

<body>
    <section class="page-wrap page-user page-index">
        <div class="user-info-box user-info-bgc-right">
            <div class="user-info-bgc-left"></div>
           
            <div class="user-info-center1">
                <div class="" id="UserInfo">

                </div>
            </div>
        </div>

        <!-- <div class="tab-box">
            <a class="my-tab runDiv" module="wdyy">
                <i class="yy"></i>
                <span class="my-tab-text">我的预约</span>
            </a>
            <a class="my-tab runDiv" module="wdqy">
                <i class="qy"></i>
                <span class="my-tab-text">我的签约</span>
            </a>
        </div> -->
         <div class="icon-list" style="background:#f5f7fd">
        <ul class="row personal" >
            <li class="col-xs-3 "  id="healthDoc">
                <div class="icon-bigbox">
                    <a class="block-a">
                        <div class="out-box business-module" >
                            <i class="icon-box icon_jkda"></i>
                            <span class="span-a-text">健康档案</span>
                        </div>
                    </a>
                </div>
            </li>
            <li class="col-xs-3 "  module="hasContract">
                <div class="icon-bigbox">
                    <a class="block-a">
                        <div class="out-box business-module" business-name="hasContract">
                            <i class="icon-box icon_jtys"></i>
                            <span class="span-a-text">家庭医生</span>
                        </div>
                    </a>
                </div>
            </li>
            <li class="col-xs-3" id="getMySign">
                <div class="icon-bigbox">
                    <a class="block-a">
                        <div class="out-box business-module" business-name="zyjf">
                            <i class="icon-box icon_jzgl"></i>
                            <span class="span-a-text">接种管理</span>
                        </div>
                    </a>
                </div>
            </li>
            <li class="col-xs-3 "  module="searchReport">
                <div class="icon-bigbox">
                    <a class="block-a block-a-bottom">
                        <div class="out-box business-module" business-name="bgcx">
                            <i class="icon-box icon_wdsc"></i>
                            <span class="span-a-text">我的收藏</span>
                        </div>
                    </a>
                </div>
            </li>

        </ul>
        <aside class="plane-box user-list-box">
            <ul class="default-list user-list">
                <li>
                    <a >
                        <div class="item-inner runDiv" module="familyList">

                            <div class="item-media">
                                <i class="icon-bar icon_qqzh"></i>
                            </div>
                            <div class="item-content">我的亲情帐号</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a >
                        <div class="item-inner runDiv" module="wdyy">
                            <div class="item-media">
                                <i class="icon-bar icon_ghjl"></i>
                            </div>
                            <div class="item-content">预约挂号记录</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a>
                        <div class="item-inner " module="wdzd">
                            <div class="item-media">
                                <i class="icon-bar icon_jzjl"></i>
                            </div>
                            <div class="item-content">预约接种记录</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a>
                        <div class="item-inner " module="zyjl">
                            <div class="item-media">
                                <i class="icon-bar icon_jfjl"></i>
                            </div>
                            <div class="item-content">门诊缴费记录</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a>
                        <div class="item-inner " module="zyjl">
                            <div class="item-media">
                                <i class="icon-bar icon_zyjl"></i>
                            </div>
                            <div class="item-content">住院记录</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a>
                        <div class="item-inner runDiv" module="consultList">
                            <div class="item-media">
                                <i class="icon-bar icon_zxzx"></i>
                            </div>
                            <div class="item-content">在线咨询</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                 <li>
                    <a>
                        <div class="item-inner  runDiv" module="sz">
                            <div class="item-media" >
                                <i class="icon-bar f6"></i>
                            </div>
                            <div class="item-content">设置</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
            </ul>
        </aside>
        <!-- <aside class="plane-box user-list-box">
            <ul class="default-list user-list">
                  <li class="newlist">
                    <a >
                        <div class="item-inner" module="wdxx">
                            <div class="item-media">
                                <i class="icon-bar f4"></i>
                            </div>
                            <div class="item-content">
                                我的消息
                                <div class="hasNews"></div>
                            </div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a >
                        <div class="item-inner  runDiv" module="sz">
                            <div class="item-media" >
                                <i class="icon-bar f6"></i>
                            </div>
                            <div class="item-content">设置</div>
                            <div class="item-after">
                                <i class="iconfont icon-more"></i>
                            </div>
                        </div>
                    </a>
                </li>
            </ul>
        </aside> -->
        <aside class="plane-box">
                <ul class="default-list quite-list">
                    <li id="quite">
                        <a>
                            <div class="item-inner">
                                <div class="item-content">退出当前登录</div>
                            </div>
                        </a>
                    </li>
                </ul>
            </aside>
            <%- include('../common/footer') %>
            <!--footer-end-->
    </section>
</body>
<!--待完善的个人信息dom-->
<script type="text/html" id="userInfoDOMDWS">
    <div class="user-photo1">
        <img src="/static/images/selfCenter-new/step2.png">
    </div>
    <div class="user-sign-box1" style="margin-top:1.5rem">
        <a>个人信息待完善</a>
    </div>
</script>
<!--已完善的个人信息dom-->
<script type="text/html" id="userInfoDOM">
    <div class="user-photo1">
        <img src="/static/images/family/userInfo_head.png">
    </div>
    <div class="user-sign-box1">
       <!--  <h3 class="h3-name"></h3> -->
        <p class="sign-box">
            <span class="h3-name" style="font-size: 1.35rem"></span>
            <span class="agree"><i></i> 已实名</span>
            
        </p>
         <p class="sign-box">
            <span >身份证号：</span>
            <span class="span-sfzh">2222222</span>
        </p>
        <p class="sign-box">
            <span> 联系电话：</span>
            <span class="span-lxdh">2222222</span>
        </p>
    </div>
</script>
<script type="text/javascript">
</script>
</html>